home *** CD-ROM | disk | FTP | other *** search
/ Aminet 50 / Aminet 50 (2002)(GTI - Schatztruhe)[!][Aug 2002].iso / Aminet / dev / gcc / ppc-mos-gcc.lha / info / gcc.info-7 (.txt) < prev    next >
GNU Info File  |  2002-06-18  |  43KB  |  736 lines

  1. This is Info file gcc.info, produced by Makeinfo version 1.68 from the
  2. input file ./gcc.texi.
  3. INFO-DIR-SECTION Programming
  4. START-INFO-DIR-ENTRY
  5. * gcc: (gcc).                  The GNU Compiler Collection.
  6. END-INFO-DIR-ENTRY
  7.    This file documents the use and the internals of the GNU compiler.
  8.    Published by the Free Software Foundation 59 Temple Place - Suite 330
  9. Boston, MA 02111-1307 USA
  10.    Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
  11. 1999, 2000 Free Software Foundation, Inc.
  12.    Permission is granted to make and distribute verbatim copies of this
  13. manual provided the copyright notice and this permission notice are
  14. preserved on all copies.
  15.    Permission is granted to copy and distribute modified versions of
  16. this manual under the conditions for verbatim copying, provided also
  17. that the sections entitled "GNU General Public License" and "Funding
  18. for Free Software" are included exactly as in the original, and
  19. provided that the entire resulting derived work is distributed under
  20. the terms of a permission notice identical to this one.
  21.    Permission is granted to copy and distribute translations of this
  22. manual into another language, under the above conditions for modified
  23. versions, except that the sections entitled "GNU General Public
  24. License" and "Funding for Free Software", and this permission notice,
  25. may be included in translations approved by the Free Software Foundation
  26. instead of in the original English.
  27. File: gcc.info,  Node: Environment Variables,  Next: Running Protoize,  Prev: Code Gen Options,  Up: Invoking GCC
  28. Environment Variables Affecting GCC
  29. ===================================
  30.    This section describes several environment variables that affect how
  31. GCC operates.  Some of them work by specifying directories or prefixes
  32. to use when searching for various kinds of files. Some are used to
  33. specify other aspects of the compilation environment.
  34.    Note that you can also specify places to search using options such as
  35. `-B', `-I' and `-L' (*note Directory Options::.).  These take
  36. precedence over places specified using environment variables, which in
  37. turn take precedence over those specified by the configuration of GCC.
  38. *Note Driver::.
  39. `LANG'
  40. `LC_CTYPE'
  41. `LC_MESSAGES'
  42. `LC_ALL'
  43.      These environment variables control the way that GCC uses
  44.      localization information that allow GCC to work with different
  45.      national conventions.  GCC inspects the locale categories
  46.      `LC_CTYPE' and `LC_MESSAGES' if it has been configured to do so.
  47.      These locale categories can be set to any value supported by your
  48.      installation.  A typical value is `en_UK' for English in the United
  49.      Kingdom.
  50.      The `LC_CTYPE' environment variable specifies character
  51.      classification.  GCC uses it to determine the character boundaries
  52.      in a string; this is needed for some multibyte encodings that
  53.      contain quote and escape characters that would otherwise be
  54.      interpreted as a string end or escape.
  55.      The `LC_MESSAGES' environment variable specifies the language to
  56.      use in diagnostic messages.
  57.      If the `LC_ALL' environment variable is set, it overrides the value
  58.      of `LC_CTYPE' and `LC_MESSAGES'; otherwise, `LC_CTYPE' and
  59.      `LC_MESSAGES' default to the value of the `LANG' environment
  60.      variable.  If none of these variables are set, GCC defaults to
  61.      traditional C English behavior.
  62. `TMPDIR'
  63.      If `TMPDIR' is set, it specifies the directory to use for temporary
  64.      files.  GCC uses temporary files to hold the output of one stage of
  65.      compilation which is to be used as input to the next stage: for
  66.      example, the output of the preprocessor, which is the input to the
  67.      compiler proper.
  68. `GCC_EXEC_PREFIX'
  69.      If `GCC_EXEC_PREFIX' is set, it specifies a prefix to use in the
  70.      names of the subprograms executed by the compiler.  No slash is
  71.      added when this prefix is combined with the name of a subprogram,
  72.      but you can specify a prefix that ends with a slash if you wish.
  73.      If GCC cannot find the subprogram using the specified prefix, it
  74.      tries looking in the usual places for the subprogram.
  75.      The default value of `GCC_EXEC_PREFIX' is `PREFIX/lib/gcc-lib/'
  76.      where PREFIX is the value of `prefix' when you ran the `configure'
  77.      script.
  78.      Other prefixes specified with `-B' take precedence over this
  79.      prefix.
  80.      This prefix is also used for finding files such as `crt0.o' that
  81.      are used for linking.
  82.      In addition, the prefix is used in an unusual way in finding the
  83.      directories to search for header files.  For each of the standard
  84.      directories whose name normally begins with
  85.      `/usr/local/lib/gcc-lib' (more precisely, with the value of
  86.      `GCC_INCLUDE_DIR'), GCC tries replacing that beginning with the
  87.      specified prefix to produce an alternate directory name.  Thus,
  88.      with `-Bfoo/', GCC will search `foo/bar' where it would normally
  89.      search `/usr/local/lib/bar'.  These alternate directories are
  90.      searched first; the standard directories come next.
  91. `COMPILER_PATH'
  92.      The value of `COMPILER_PATH' is a colon-separated list of
  93.      directories, much like `PATH'.  GCC tries the directories thus
  94.      specified when searching for subprograms, if it can't find the
  95.      subprograms using `GCC_EXEC_PREFIX'.
  96. `LIBRARY_PATH'
  97.      The value of `LIBRARY_PATH' is a colon-separated list of
  98.      directories, much like `PATH'.  When configured as a native
  99.      compiler, GCC tries the directories thus specified when searching
  100.      for special linker files, if it can't find them using
  101.      `GCC_EXEC_PREFIX'.  Linking using GCC also uses these directories
  102.      when searching for ordinary libraries for the `-l' option (but
  103.      directories specified with `-L' come first).
  104. `C_INCLUDE_PATH'
  105. `CPLUS_INCLUDE_PATH'
  106. `OBJC_INCLUDE_PATH'
  107.      These environment variables pertain to particular languages.  Each
  108.      variable's value is a colon-separated list of directories, much
  109.      like `PATH'.  When GCC searches for header files, it tries the
  110.      directories listed in the variable for the language you are using,
  111.      after the directories specified with `-I' but before the standard
  112.      header file directories.
  113. `DEPENDENCIES_OUTPUT'
  114.      If this variable is set, its value specifies how to output
  115.      dependencies for Make based on the header files processed by the
  116.      compiler.  This output looks much like the output from the `-M'
  117.      option (*note Preprocessor Options::.), but it goes to a separate
  118.      file, and is in addition to the usual results of compilation.
  119.      The value of `DEPENDENCIES_OUTPUT' can be just a file name, in
  120.      which case the Make rules are written to that file, guessing the
  121.      target name from the source file name.  Or the value can have the
  122.      form `FILE TARGET', in which case the rules are written to file
  123.      FILE using TARGET as the target name.
  124. `LANG'
  125.      This variable is used to pass locale information to the compiler.
  126.      One way in which this information is used is to determine the
  127.      character set to be used when character literals, string literals
  128.      and comments are parsed in C and C++.  When the compiler is
  129.      configured to allow multibyte characters, the following values for
  130.      `LANG' are recognized:
  131.     `C-JIS'
  132.           Recognize JIS characters.
  133.     `C-SJIS'
  134.           Recognize SJIS characters.
  135.     `C-EUCJP'
  136.           Recognize EUCJP characters.
  137.      If `LANG' is not defined, or if it has some other value, then the
  138.      compiler will use mblen and mbtowc as defined by the default
  139.      locale to recognize and translate multibyte characters.
  140. File: gcc.info,  Node: Running Protoize,  Prev: Environment Variables,  Up: Invoking GCC
  141. Running Protoize
  142. ================
  143.    The program `protoize' is an optional part of GNU C.  You can use it
  144. to add prototypes to a program, thus converting the program to ANSI C
  145. in one respect.  The companion program `unprotoize' does the reverse:
  146. it removes argument types from any prototypes that are found.
  147.    When you run these programs, you must specify a set of source files
  148. as command line arguments.  The conversion programs start out by
  149. compiling these files to see what functions they define.  The
  150. information gathered about a file FOO is saved in a file named `FOO.X'.
  151.    After scanning comes actual conversion.  The specified files are all
  152. eligible to be converted; any files they include (whether sources or
  153. just headers) are eligible as well.
  154.    But not all the eligible files are converted.  By default,
  155. `protoize' and `unprotoize' convert only source and header files in the
  156. current directory.  You can specify additional directories whose files
  157. should be converted with the `-d DIRECTORY' option.  You can also
  158. specify particular files to exclude with the `-x FILE' option.  A file
  159. is converted if it is eligible, its directory name matches one of the
  160. specified directory names, and its name within the directory has not
  161. been excluded.
  162.    Basic conversion with `protoize' consists of rewriting most function
  163. definitions and function declarations to specify the types of the
  164. arguments.  The only ones not rewritten are those for varargs functions.
  165.    `protoize' optionally inserts prototype declarations at the
  166. beginning of the source file, to make them available for any calls that
  167. precede the function's definition.  Or it can insert prototype
  168. declarations with block scope in the blocks where undeclared functions
  169. are called.
  170.    Basic conversion with `unprotoize' consists of rewriting most
  171. function declarations to remove any argument types, and rewriting
  172. function definitions to the old-style pre-ANSI form.
  173.    Both conversion programs print a warning for any function
  174. declaration or definition that they can't convert.  You can suppress
  175. these warnings with `-q'.
  176.    The output from `protoize' or `unprotoize' replaces the original
  177. source file.  The original file is renamed to a name ending with
  178. `.save'.  If the `.save' file already exists, then the source file is
  179. simply discarded.
  180.    `protoize' and `unprotoize' both depend on GCC itself to scan the
  181. program and collect information about the functions it uses.  So
  182. neither of these programs will work until GCC is installed.
  183.    Here is a table of the options you can use with `protoize' and
  184. `unprotoize'.  Each option works with both programs unless otherwise
  185. stated.
  186. `-B DIRECTORY'
  187.      Look for the file `SYSCALLS.c.X' in DIRECTORY, instead of the
  188.      usual directory (normally `/usr/local/lib').  This file contains
  189.      prototype information about standard system functions.  This option
  190.      applies only to `protoize'.
  191. `-c COMPILATION-OPTIONS'
  192.      Use  COMPILATION-OPTIONS as the options when running `gcc' to
  193.      produce the `.X' files.  The special option `-aux-info' is always
  194.      passed in addition, to tell `gcc' to write a `.X' file.
  195.      Note that the compilation options must be given as a single
  196.      argument to `protoize' or `unprotoize'.  If you want to specify
  197.      several `gcc' options, you must quote the entire set of
  198.      compilation options to make them a single word in the shell.
  199.      There are certain `gcc' arguments that you cannot use, because they
  200.      would produce the wrong kind of output.  These include `-g', `-O',
  201.      `-c', `-S', and `-o' If you include these in the
  202.      COMPILATION-OPTIONS, they are ignored.
  203.      Rename files to end in `.C' instead of `.c'.  This is convenient
  204.      if you are converting a C program to C++.  This option applies
  205.      only to `protoize'.
  206.      Add explicit global declarations.  This means inserting explicit
  207.      declarations at the beginning of each source file for each function
  208.      that is called in the file and was not declared.  These
  209.      declarations precede the first function definition that contains a
  210.      call to an undeclared function.  This option applies only to
  211.      `protoize'.
  212. `-i STRING'
  213.      Indent old-style parameter declarations with the string STRING.
  214.      This option applies only to `protoize'.
  215.      `unprotoize' converts prototyped function definitions to old-style
  216.      function definitions, where the arguments are declared between the
  217.      argument list and the initial `{'.  By default, `unprotoize' uses
  218.      five spaces as the indentation.  If you want to indent with just
  219.      one space instead, use `-i " "'.
  220.      Keep the `.X' files.  Normally, they are deleted after conversion
  221.      is finished.
  222.      Add explicit local declarations.  `protoize' with `-l' inserts a
  223.      prototype declaration for each function in each block which calls
  224.      the function without any declaration.  This option applies only to
  225.      `protoize'.
  226.      Make no real changes.  This mode just prints information about the
  227.      conversions that would have been done without `-n'.
  228.      Make no `.save' files.  The original files are simply deleted.
  229.      Use this option with caution.
  230. `-p PROGRAM'
  231.      Use the program PROGRAM as the compiler.  Normally, the name `gcc'
  232.      is used.
  233.      Work quietly.  Most warnings are suppressed.
  234.      Print the version number, just like `-v' for `gcc'.
  235.    If you need special compiler options to compile one of your program's
  236. source files, then you should generate that file's `.X' file specially,
  237. by running `gcc' on that source file with the appropriate options and
  238. the option `-aux-info'.  Then run `protoize' on the entire set of
  239. files.  `protoize' will use the existing `.X' file because it is newer
  240. than the source file.  For example:
  241.      gcc -Dfoo=bar file1.c -aux-info
  242.      protoize *.c
  243. You need to include the special files along with the rest in the
  244. `protoize' command, even though their `.X' files already exist, because
  245. otherwise they won't get converted.
  246.    *Note Protoize Caveats::, for more information on how to use
  247. `protoize' successfully.
  248.    Note most of this information is out of date and superceded by the
  249. EGCS install procedures.  It is provided for historical reference only.
  250. File: gcc.info,  Node: Installation,  Next: C Extensions,  Prev: Invoking GCC,  Up: Top
  251. Installing GNU CC
  252. *****************
  253. * Menu:
  254. * Configuration Files::  Files created by running `configure'.
  255. * Configurations::    Configurations Supported by GNU CC.
  256. * Other Dir::     Compiling in a separate directory (not where the source is).
  257. * Cross-Compiler::   Building and installing a cross-compiler.
  258. * Sun Install::   See below for installation on the Sun.
  259. * VMS Install::   See below for installation on VMS.
  260. * Collect2::      How `collect2' works; how it finds `ld'.
  261. * Header Dirs::   Understanding the standard header file directories.
  262.    Here is the procedure for installing GNU CC on a GNU or Unix system.
  263. See *Note VMS Install::., for VMS systems.  In this section we assume
  264. you compile in the same directory that contains the source files; see
  265. *Note Other Dir::., to find out how to compile in a separate directory
  266. on Unix systems.
  267.    You cannot install GNU C by itself on MSDOS; it will not compile
  268. under any MSDOS compiler except itself.  You need to get the complete
  269. compilation package DJGPP, which includes binaries as well as sources,
  270. and includes all the necessary compilation tools and libraries.
  271.   1. If you have built GNU CC previously in the same directory for a
  272.      different target machine, do `make distclean' to delete all files
  273.      that might be invalid.  One of the files this deletes is
  274.      `Makefile'; if `make distclean' complains that `Makefile' does not
  275.      exist, it probably means that the directory is already suitably
  276.      clean.
  277.   2. On a System V release 4 system, make sure `/usr/bin' precedes
  278.      `/usr/ucb' in `PATH'.  The `cc' command in `/usr/ucb' uses
  279.      libraries which have bugs.
  280.   3. Make sure the Bison parser generator is installed.  (This is
  281.      unnecessary if the Bison output files `c-parse.c' and `cexp.c' are
  282.      more recent than `c-parse.y' and `cexp.y' and you do not plan to
  283.      change the `.y' files.)
  284.      Bison versions older than Sept 8, 1988 will produce incorrect
  285.      output for `c-parse.c'.
  286.   4. If you have chosen a configuration for GNU CC which requires other
  287.      GNU tools (such as GAS or the GNU linker) instead of the standard
  288.      system tools, install the required tools in the build directory
  289.      under the names `as', `ld' or whatever is appropriate.  This will
  290.      enable the compiler to find the proper tools for compilation of
  291.      the program `enquire'.
  292.      Alternatively, you can do subsequent compilation using a value of
  293.      the `PATH' environment variable such that the necessary GNU tools
  294.      come before the standard system tools.
  295.   5. Specify the host, build and target machine configurations.  You do
  296.      this when you run the `configure' script.
  297.      The "build" machine is the system which you are using, the "host"
  298.      machine is the system where you want to run the resulting compiler
  299.      (normally the build machine), and the "target" machine is the
  300.      system for which you want the compiler to generate code.
  301.      If you are building a compiler to produce code for the machine it
  302.      runs on (a native compiler), you normally do not need to specify
  303.      any operands to `configure'; it will try to guess the type of
  304.      machine you are on and use that as the build, host and target
  305.      machines.  So you don't need to specify a configuration when
  306.      building a native compiler unless `configure' cannot figure out
  307.      what your configuration is or guesses wrong.
  308.      In those cases, specify the build machine's "configuration name"
  309.      with the `--host' option; the host and target will default to be
  310.      the same as the host machine.  (If you are building a
  311.      cross-compiler, see *Note Cross-Compiler::..)
  312.      Here is an example:
  313.           ./configure --host=sparc-sun-sunos4.1
  314.      A configuration name may be canonical or it may be more or less
  315.      abbreviated.
  316.      A canonical configuration name has three parts, separated by
  317.      dashes.  It looks like this: `CPU-COMPANY-SYSTEM'.  (The three
  318.      parts may themselves contain dashes; `configure' can figure out
  319.      which dashes serve which purpose.)  For example,
  320.      `m68k-sun-sunos4.1' specifies a Sun 3.
  321.      You can also replace parts of the configuration by nicknames or
  322.      aliases.  For example, `sun3' stands for `m68k-sun', so
  323.      `sun3-sunos4.1' is another way to specify a Sun 3.  You can also
  324.      use simply `sun3-sunos', since the version of SunOS is assumed by
  325.      default to be version 4.
  326.      You can specify a version number after any of the system types,
  327.      and some of the CPU types.  In most cases, the version is
  328.      irrelevant, and will be ignored.  So you might as well specify the
  329.      version if you know it.
  330.      See *Note Configurations::., for a list of supported configuration
  331.      names and notes on many of the configurations.  You should check
  332.      the notes in that section before proceeding any further with the
  333.      installation of GNU CC.
  334.   6. When running `configure', you may also need to specify certain
  335.      additional options that describe variant hardware and software
  336.      configurations.  These are `--with-gnu-as', `--with-gnu-ld',
  337.      `--with-stabs' and `--nfp'.
  338.     `--with-gnu-as'
  339.           If you will use GNU CC with the GNU assembler (GAS), you
  340.           should declare this by using the `--with-gnu-as' option when
  341.           you run `configure'.
  342.           Using this option does not install GAS.  It only modifies the
  343.           output of GNU CC to work with GAS.  Building and installing
  344.           GAS is up to you.
  345.           Conversely, if you *do not* wish to use GAS and do not specify
  346.           `--with-gnu-as' when building GNU CC, it is up to you to make
  347.           sure that GAS is not installed.  GNU CC searches for a
  348.           program named `as' in various directories; if the program it
  349.           finds is GAS, then it runs GAS.  If you are not sure where
  350.           GNU CC finds the assembler it is using, try specifying `-v'
  351.           when you run it.
  352.           The systems where it makes a difference whether you use GAS
  353.           are
  354.           `hppa1.0-ANY-ANY', `hppa1.1-ANY-ANY', `i386-ANY-sysv',
  355.           `i386-ANY-isc',
  356.           `i860-ANY-bsd', `m68k-bull-sysv',
  357.           `m68k-hp-hpux', `m68k-sony-bsd',
  358.           `m68k-altos-sysv', `m68000-hp-hpux',
  359.           `m68000-att-sysv', `ANY-lynx-lynxos', and `mips-ANY').  On
  360.           any other system, `--with-gnu-as' has no effect.
  361.           On the systems listed above (except for the HP-PA, for ISC on
  362.           the 386, and for `mips-sgi-irix5.*'), if you use GAS, you
  363.           should also use the GNU linker (and specify `--with-gnu-ld').
  364.     `--with-gnu-ld'
  365.           Specify the option `--with-gnu-ld' if you plan to use the GNU
  366.           linker with GNU CC.
  367.           This option does not cause the GNU linker to be installed; it
  368.           just modifies the behavior of GNU CC to work with the GNU
  369.           linker.
  370.     `--with-stabs'
  371.           On MIPS based systems and on Alphas, you must specify whether
  372.           you want GNU CC to create the normal ECOFF debugging format,
  373.           or to use BSD-style stabs passed through the ECOFF symbol
  374.           table.  The normal ECOFF debug format cannot fully handle
  375.           languages other than C.  BSD stabs format can handle other
  376.           languages, but it only works with the GNU debugger GDB.
  377.           Normally, GNU CC uses the ECOFF debugging format by default;
  378.           if you prefer BSD stabs, specify `--with-stabs' when you
  379.           configure GNU CC.
  380.           No matter which default you choose when you configure GNU CC,
  381.           the user can use the `-gcoff' and `-gstabs+' options to
  382.           specify explicitly the debug format for a particular
  383.           compilation.
  384.           `--with-stabs' is meaningful on the ISC system on the 386,
  385.           also, if `--with-gas' is used.  It selects use of stabs
  386.           debugging information embedded in COFF output.  This kind of
  387.           debugging information supports C++ well; ordinary COFF
  388.           debugging information does not.
  389.           `--with-stabs' is also meaningful on 386 systems running
  390.           SVR4.  It selects use of stabs debugging information embedded
  391.           in ELF output.  The C++ compiler currently (2.6.0) does not
  392.           support the DWARF debugging information normally used on 386
  393.           SVR4 platforms; stabs provide a workable alternative.  This
  394.           requires gas and gdb, as the normal SVR4 tools can not
  395.           generate or interpret stabs.
  396.     `--nfp'
  397.           On certain systems, you must specify whether the machine has
  398.           a floating point unit.  These systems include
  399.           `m68k-sun-sunosN' and `m68k-isi-bsd'.  On any other system,
  400.           `--nfp' currently has no effect, though perhaps there are
  401.           other systems where it could usefully make a difference.
  402.     `--enable-haifa'
  403.     `--disable-haifa'
  404.           Use `--enable-haifa' to enable use of an experimental
  405.           instruction scheduler (from IBM Haifa).  This may or may not
  406.           produce better code.  Some targets on which it is known to be
  407.           a win enable it by default; use `--disable-haifa' to disable
  408.           it in these cases.  `configure' will print out whether the
  409.           Haifa scheduler is enabled when it is run.
  410.     `--enable-threads=TYPE'
  411.           Certain systems, notably Linux-based GNU systems, can't be
  412.           relied on to supply a threads facility for the Objective C
  413.           runtime and so will default to single-threaded runtime.  They
  414.           may, however, have a library threads implementation
  415.           available, in which case threads can be enabled with this
  416.           option by supplying a suitable TYPE, probably `posix'.  The
  417.           possibilities for TYPE are `single', `posix', `win32',
  418.           `solaris', `irix' and `mach'.
  419.     `--enable-checking'
  420.           When you specify this option, the compiler is built to
  421.           perform checking of tree node types when referencing fields
  422.           of that node.  This does not change the generated code, but
  423.           adds error checking within the compiler.  This will slow down
  424.           the compiler and may only work properly if you are building
  425.           the compiler with GNU C.
  426.           The `configure' script searches subdirectories of the source
  427.           directory for other compilers that are to be integrated into
  428.           GNU CC.  The GNU compiler for C++, called G++ is in a
  429.           subdirectory named `cp'.  `configure' inserts rules into
  430.           `Makefile' to build all of those compilers.
  431.           Here we spell out what files will be set up by `configure'.
  432.           Normally you need not be concerned with these files.
  433.              * A file named `config.h' is created that contains a
  434.                `#include' of the top-level config file for the machine
  435.                you will run the compiler on (*note Config::.).  This
  436.                file is responsible for defining information about the
  437.                host machine.  It includes `tm.h'.
  438.                The top-level config file is located in the subdirectory
  439.                `config'.  Its name is always `xm-SOMETHING.h'; usually
  440.                `xm-MACHINE.h', but there are some exceptions.
  441.                If your system does not support symbolic links, you
  442.                might want to set up `config.h' to contain a `#include'
  443.                command which refers to the appropriate file.
  444.              * A file named `tconfig.h' is created which includes the
  445.                top-level config file for your target machine.  This is
  446.                used for compiling certain programs to run on that
  447.                machine.
  448.              * A file named `tm.h' is created which includes the
  449.                machine-description macro file for your target machine.
  450.                It should be in the subdirectory `config' and its name
  451.                is often `MACHINE.h'.
  452.     `--enable-nls'
  453.     `--disable-nls'
  454.           The `--enable-nls' option enables Native Language Support
  455.           (NLS), which lets GCC output diagnostics in languages other
  456.           than American English.  No translations are available yet, so
  457.           the main users of this option now are those translating GCC's
  458.           diagnostics who want to test their work.  Once translations
  459.           become available, Native Language Support will become enabled
  460.           by default.  The `--disable-nls' option disables NLS.
  461.     `--with-included-gettext'
  462.           If NLS is enabled, the GCC build procedure normally attempts
  463.           to use the host's `gettext' libraries, and falls back on
  464.           GCC's copy of the GNU `gettext' library only if the host
  465.           libraries do not suffice.  The `--with-included-gettext'
  466.           option causes the build procedure to prefer its copy of GNU
  467.           `gettext'.
  468.     `--with-catgets'
  469.           If NLS is enabled, and if the host lacks `gettext' but has the
  470.           inferior `catgets' interface, the GCC build procedure normally
  471.           ignores `catgets' and instead uses GCC's copy of the GNU
  472.           `gettext' library.  The `--with-catgets' option causes the
  473.           build procedure to use the host's `catgets' in this situation.
  474.   7. In certain cases, you should specify certain other options when
  475.      you run `configure'.
  476.         * The standard directory for installing GNU CC is
  477.           `/usr/local/lib'.  If you want to install its files somewhere
  478.           else, specify `--prefix=DIR' when you run `configure'.  Here
  479.           DIR is a directory name to use instead of `/usr/local' for
  480.           all purposes with one exception: the directory
  481.           `/usr/local/include' is searched for header files no matter
  482.           where you install the compiler.  To override this name, use
  483.           the `--with-local-prefix' option below.  The directory you
  484.           specify need not exist, but its parent directory must exist.
  485.         * Specify `--with-local-prefix=DIR' if you want the compiler to
  486.           search directory `DIR/include' for locally installed header
  487.           files *instead* of `/usr/local/include'.
  488.           You should specify `--with-local-prefix' *only* if your site
  489.           has a different convention (not `/usr/local') for where to put
  490.           site-specific files.
  491.           The default value for `--with-local-prefix' is `/usr/local'
  492.           regardless of the value of `--prefix'.  Specifying `--prefix'
  493.           has no effect on which directory GNU CC searches for local
  494.           header files.  This may seem counterintuitive, but actually
  495.           it is logical.
  496.           The purpose of `--prefix' is to specify where to *install GNU
  497.           CC*.  The local header files in `/usr/local/include'--if you
  498.           put any in that directory--are not part of GNU CC.  They are
  499.           part of other programs--perhaps many others.  (GNU CC
  500.           installs its own header files in another directory which is
  501.           based on the `--prefix' value.)
  502.           *Do not* specify `/usr' as the `--with-local-prefix'!  The
  503.           directory you use for `--with-local-prefix' *must not* contain
  504.           any of the system's standard header files.  If it did contain
  505.           them, certain programs would be miscompiled (including GNU
  506.           Emacs, on certain targets), because this would override and
  507.           nullify the header file corrections made by the `fixincludes'
  508.           script.
  509.           Indications are that people who use this option use it based
  510.           on mistaken ideas of what it is for.  People use it as if it
  511.           specified where to install part of GNU CC.  Perhaps they make
  512.           this assumption because installing GNU CC creates the
  513.           directory.
  514.   8. Build the compiler.  Just type `make LANGUAGES=c' in the compiler
  515.      directory.
  516.      `LANGUAGES=c' specifies that only the C compiler should be
  517.      compiled.  The makefile normally builds compilers for all the
  518.      supported languages; currently, C, C++ and Objective C.  However,
  519.      C is the only language that is sure to work when you build with
  520.      other non-GNU C compilers.  In addition, building anything but C
  521.      at this stage is a waste of time.
  522.      In general, you can specify the languages to build by typing the
  523.      argument `LANGUAGES="LIST"', where LIST is one or more words from
  524.      the list `c', `c++', and `objective-c'.  If you have any
  525.      additional GNU compilers as subdirectories of the GNU CC source
  526.      directory, you may also specify their names in this list.
  527.      Ignore any warnings you may see about "statement not reached" in
  528.      `insn-emit.c'; they are normal.  Also, warnings about "unknown
  529.      escape sequence" are normal in `genopinit.c' and perhaps some
  530.      other files.  Likewise, you should ignore warnings about "constant
  531.      is so large that it is unsigned" in `insn-emit.c' and
  532.      `insn-recog.c', a warning about a comparison always being zero in
  533.      `enquire.o', and warnings about shift counts exceeding type widths
  534.      in `cexp.y'.  Any other compilation errors may represent bugs in
  535.      the port to your machine or operating system, and should be
  536.      investigated and reported (*note Bugs::.).
  537.      Some compilers fail to compile GNU CC because they have bugs or
  538.      limitations.  For example, the Microsoft compiler is said to run
  539.      out of macro space.  Some Ultrix compilers run out of expression
  540.      space; then you need to break up the statement where the problem
  541.      happens.
  542.   9. If you are building a cross-compiler, stop here.  *Note
  543.      Cross-Compiler::.
  544.  10. Move the first-stage object files and executables into a
  545.      subdirectory with this command:
  546.           make stage1
  547.      The files are moved into a subdirectory named `stage1'.  Once
  548.      installation is complete, you may wish to delete these files with
  549.      `rm -r stage1'.
  550.  11. If you have chosen a configuration for GNU CC which requires other
  551.      GNU tools (such as GAS or the GNU linker) instead of the standard
  552.      system tools, install the required tools in the `stage1'
  553.      subdirectory under the names `as', `ld' or whatever is
  554.      appropriate.  This will enable the stage 1 compiler to find the
  555.      proper tools in the following stage.
  556.      Alternatively, you can do subsequent compilation using a value of
  557.      the `PATH' environment variable such that the necessary GNU tools
  558.      come before the standard system tools.
  559.  12. Recompile the compiler with itself, with this command:
  560.           make CC="stage1/xgcc -Bstage1/" CFLAGS="-g -O2"
  561.      This is called making the stage 2 compiler.
  562.      The command shown above builds compilers for all the supported
  563.      languages.  If you don't want them all, you can specify the
  564.      languages to build by typing the argument `LANGUAGES="LIST"'.  LIST
  565.      should contain one or more words from the list `c', `c++',
  566.      `objective-c', and `proto'.  Separate the words with spaces.
  567.      `proto' stands for the programs `protoize' and `unprotoize'; they
  568.      are not a separate language, but you use `LANGUAGES' to enable or
  569.      disable their installation.
  570.      If you are going to build the stage 3 compiler, then you might
  571.      want to build only the C language in stage 2.
  572.      Once you have built the stage 2 compiler, if you are short of disk
  573.      space, you can delete the subdirectory `stage1'.
  574.      On a 68000 or 68020 system lacking floating point hardware, unless
  575.      you have selected a `tm.h' file that expects by default that there
  576.      is no such hardware, do this instead:
  577.           make CC="stage1/xgcc -Bstage1/" CFLAGS="-g -O2 -msoft-float"
  578.  13. If you wish to test the compiler by compiling it with itself one
  579.      more time, install any other necessary GNU tools (such as GAS or
  580.      the GNU linker) in the `stage2' subdirectory as you did in the
  581.      `stage1' subdirectory, then do this:
  582.           make stage2
  583.           make CC="stage2/xgcc -Bstage2/" CFLAGS="-g -O2"
  584.      This is called making the stage 3 compiler.  Aside from the `-B'
  585.      option, the compiler options should be the same as when you made
  586.      the stage 2 compiler.  But the `LANGUAGES' option need not be the
  587.      same.  The command shown above builds compilers for all the
  588.      supported languages; if you don't want them all, you can specify
  589.      the languages to build by typing the argument `LANGUAGES="LIST"',
  590.      as described above.
  591.      If you do not have to install any additional GNU tools, you may
  592.      use the command
  593.           make bootstrap LANGUAGES=LANGUAGE-LIST BOOT_CFLAGS=OPTION-LIST
  594.      instead of making `stage1', `stage2', and performing the two
  595.      compiler builds.
  596.  14. Compare the latest object files with the stage 2 object files--they
  597.      ought to be identical, aside from time stamps (if any).
  598.      On some systems, meaningful comparison of object files is
  599.      impossible; they always appear "different."  This is currently
  600.      true on Solaris and some systems that use ELF object file format.
  601.      On some versions of Irix on SGI machines and DEC Unix (OSF/1) on
  602.      Alpha systems, you will not be able to compare the files without
  603.      specifying `-save-temps'; see the description of individual
  604.      systems above to see if you get comparison failures.  You may have
  605.      similar problems on other systems.
  606.      Use this command to compare the files:
  607.           make compare
  608.      This will mention any object files that differ between stage 2 and
  609.      stage 3.  Any difference, no matter how innocuous, indicates that
  610.      the stage 2 compiler has compiled GNU CC incorrectly, and is
  611.      therefore a potentially serious bug which you should investigate
  612.      and report (*note Bugs::.).
  613.      If your system does not put time stamps in the object files, then
  614.      this is a faster way to compare them (using the Bourne shell):
  615.           for file in *.o; do
  616.           cmp $file stage2/$file
  617.           done
  618.      If you have built the compiler with the `-mno-mips-tfile' option on
  619.      MIPS machines, you will not be able to compare the files.
  620.  15. Install the compiler driver, the compiler's passes and run-time
  621.      support with `make install'.  Use the same value for `CC',
  622.      `CFLAGS' and `LANGUAGES' that you used when compiling the files
  623.      that are being installed.  One reason this is necessary is that
  624.      some versions of Make have bugs and recompile files gratuitously
  625.      when you do this step.  If you use the same variable values, those
  626.      files will be recompiled properly.
  627.      For example, if you have built the stage 2 compiler, you can use
  628.      the following command:
  629.           make install CC="stage2/xgcc -Bstage2/" CFLAGS="-g -O" LANGUAGES="LIST"
  630.      This copies the files `cc1', `cpp' and `libgcc.a' to files `cc1',
  631.      `cpp' and `libgcc.a' in the directory
  632.      `/usr/local/lib/gcc-lib/TARGET/VERSION', which is where the
  633.      compiler driver program looks for them.  Here TARGET is the
  634.      canonicalized form of target machine type specified when you ran
  635.      `configure', and VERSION is the version number of GNU CC.  This
  636.      naming scheme permits various versions and/or cross-compilers to
  637.      coexist.  It also copies the executables for compilers for other
  638.      languages (e.g., `cc1plus' for C++) to the same directory.
  639.      This also copies the driver program `xgcc' into
  640.      `/usr/local/bin/gcc', so that it appears in typical execution
  641.      search paths.  It also copies `gcc.1' into `/usr/local/man/man1'
  642.      and info pages into `/usr/local/info'.
  643.      On some systems, this command causes recompilation of some files.
  644.      This is usually due to bugs in `make'.  You should either ignore
  645.      this problem, or use GNU Make.
  646.      *Warning: there is a bug in `alloca' in the Sun library.  To avoid
  647.      this bug, be sure to install the executables of GNU CC that were
  648.      compiled by GNU CC.  (That is, the executables from stage 2 or 3,
  649.      not stage 1.)  They use `alloca' as a built-in function and never
  650.      the one in the library.*
  651.      (It is usually better to install GNU CC executables from stage 2
  652.      or 3, since they usually run faster than the ones compiled with
  653.      some other compiler.)
  654.  16. If you're going to use C++, you need to install the C++ runtime
  655.      library.  This includes all I/O functionality, special class
  656.      libraries, etc.
  657.      The standard C++ runtime library for GNU CC is called `libstdc++'.
  658.      An obsolescent library `libg++' may also be available, but it's
  659.      necessary only for older software that hasn't been converted yet;
  660.      if you don't know whether you need `libg++' then you probably don't
  661.      need it.
  662.      Here's one way to build and install `libstdc++' for GNU CC:
  663.         * Build and install GNU CC, so that invoking `gcc' obtains the
  664.           GNU CC that was just built.
  665.         * Obtain a copy of a compatible `libstdc++' distribution.  For
  666.           example, the `libstdc++-2.8.0.tar.gz' distribution should be
  667.           compatible with GCC 2.8.0.  GCC distributors normally
  668.           distribute `libstdc++' as well.
  669.         * Set the `CXX' environment variable to `gcc' while running the
  670.           `libstdc++' distribution's `configure' command.  Use the same
  671.           `configure' options that you used when you invoked GCC's
  672.           `configure' command.
  673.         * Invoke `make' to build the C++ runtime.
  674.         * Invoke `make install' to install the C++ runtime.
  675.      To summarize, after building and installing GNU CC, invoke the
  676.      following shell commands in the topmost directory of the C++
  677.      library distribution.  For CONFIGURE-OPTIONS, use the same options
  678.      that you used to configure GNU CC.
  679.           $ CXX=gcc ./configure CONFIGURE-OPTIONS
  680.           $ make
  681.           $ make install
  682.  17. GNU CC includes a runtime library for Objective-C because it is an
  683.      integral part of the language.  You can find the files associated
  684.      with the library in the subdirectory `objc'.  The GNU Objective-C
  685.      Runtime Library requires header files for the target's C library in
  686.      order to be compiled,and also requires the header files for the
  687.      target's thread library if you want thread support.  *Note
  688.      Cross-Compilers and Header Files: Cross Headers, for discussion
  689.      about header files issues for cross-compilation.
  690.      When you run `configure', it picks the appropriate Objective-C
  691.      thread implementation file for the target platform.  In some
  692.      situations, you may wish to choose a different back-end as some
  693.      platforms support multiple thread implementations or you may wish
  694.      to disable thread support completely.  You do this by specifying a
  695.      value for the OBJC_THREAD_FILE makefile variable on the command
  696.      line when you run make, for example:
  697.           make CC="stage2/xgcc -Bstage2/" CFLAGS="-g -O2" OBJC_THREAD_FILE=thr-single
  698.      Below is a list of the currently available back-ends.
  699.         * thr-single Disable thread support, should work for all
  700.           platforms.
  701.         * thr-decosf1 DEC OSF/1 thread support.
  702.         * thr-irix SGI IRIX thread support.
  703.         * thr-mach Generic MACH thread support, known to work on
  704.           NEXTSTEP.
  705.         * thr-os2 IBM OS/2 thread support.
  706.         * thr-posix Generix POSIX thread support.
  707.         * thr-pthreads PCThreads on Linux-based GNU systems.
  708.         * thr-solaris SUN Solaris thread support.
  709.         * thr-win32 Microsoft Win32 API thread support.
  710. File: gcc.info,  Node: Configuration Files,  Next: Configurations,  Up: Installation
  711. Files Created by `configure'
  712. ============================
  713.    Here we spell out what files will be set up by `configure'.  Normally
  714. you need not be concerned with these files.
  715.    * A file named `config.h' is created that contains a `#include' of
  716.      the top-level config file for the machine you will run the compiler
  717.      on (*note Config::.).  This file is responsible for defining
  718.      information about the host machine.  It includes `tm.h'.
  719.      The top-level config file is located in the subdirectory `config'.
  720.      Its name is always `xm-SOMETHING.h'; usually `xm-MACHINE.h', but
  721.      there are some exceptions.
  722.      If your system does not support symbolic links, you might want to
  723.      set up `config.h' to contain a `#include' command which refers to
  724.      the appropriate file.
  725.    * A file named `tconfig.h' is created which includes the top-level
  726.      config file for your target machine.  This is used for compiling
  727.      certain programs to run on that machine.
  728.    * A file named `tm.h' is created which includes the
  729.      machine-description macro file for your target machine.  It should
  730.      be in the subdirectory `config' and its name is often `MACHINE.h'.
  731.    * The command file `configure' also constructs the file `Makefile'
  732.      by adding some text to the template file `Makefile.in'.  The
  733.      additional text comes from files in the `config' directory, named
  734.      `t-TARGET' and `x-HOST'.  If these files do not exist, it means
  735.      nothing needs to be added for a given target or host.
  736.